<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="keywords" content="美食,团购,外卖,网上订餐,酒店,旅游,电影票,火车票,飞机票">
    <meta name="description" content="美食攻略,外卖网上订餐,酒店预订,旅游团购,飞机票火车票,电影票,ktv团购吃喝玩乐全都有!店铺信息查询,商家评分/评价一站式生活服务网站">
    <title>{$setting['title']}</title>
    <link rel="stylesheet" href="{RES}/plugin/light7/light7.min.css">
    <link rel="stylesheet" type="text/css" href="{php echo $this->cur_mobile_path}/css/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="{php echo $this->cur_mobile_path}/css/api.css"/>
    <link rel="stylesheet" type="text/css" href="{php echo $this->cur_mobile_path}/css/common.css"/>
    <link rel="stylesheet" href="{php echo $this->cur_mobile_path}/css/shop.css?v=3">
    <link rel="stylesheet" type="text/css" href="{php echo $this->cur_mobile_path}/css/fakeLoader.css">
    <script src="{php echo $this->cur_mobile_path}/script/jquery-1.8.3.min.js"></script>
    <style>
        i {
            width: 12px;
            height: 12px;
            display: inline-block;
            line-height: 12px;
            font-size: 12px;
            margin-right: 2px;
            text-align: center;
            color: #fff;
            border-radius: 2px;
        }
        .icon-bg1{ background:#70bc46;}
        .icon-bg2{ background:#f07373;}
        .icon-bg3{ background:#f1884f;}
        .icon-bg4{ background:#f5a317;}
        .info {
            font-size: 10px;
            color: #a7a2a9;
        }
        .icon-delivery {
            padding: 0 1px;
        border: 1px solid {$setting['style_base']};
        border-radius: 2px;
        background-color: #fff;
        color: {$setting['style_base']};
        font-size: 10px;
        line-height: 12px;
        }
        .footer-bar.bar-tab .tab-item.active .icon, .bar-tab .tab-item:active .icon {
        color: {$setting['style_base']};
        }
        .footer-bar.bar-tab .tab-item.active, .bar-tab .tab-item:active {
        color: {$setting['style_base']};
        }

        .search_pic_box{ display: -webkit-box; display: -webkit-flex; display: flex; height:40px; background:#ff7f00; padding:5px 10px; box-sizing:border-box; -webkit-box-sizing:border-box;}
        .search_pic_box_fiexd{ z-index:99; background:transparent !important; position:absolute; top:0; left:0; width:100%;}
        .search_pic_box .search_pic{ width:90px; height:30px; float:left;}
        .search_pic_box .search_pic img{ width:100%;max-height:100%;}
        .search_pic_box .search_box{ margin-left:0px; -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; position:relative; margin-top:2px; background:#fff; border-radius:15px; height:26px; overflow:hidden;}
        .search_pic_box .search_box form{ display: -webkit-box; display: -webkit-flex; display: flex; }
        .search_pic_box .search_box input[type=text]{padding:3px 0; -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; font-size:0.8em; height:20px; line-height:20px; border:none; margin-left:10px;margin-top: 3px;}
        .search_pic_box .search_box .search_button{ background: #fff; border-top-right-radius: 15px; border-bottom-right-radius: 15px; width:40px; height:26px; line-height:26px; font-size:0.9em; text-align:left; color:#f47944;}

        .search_text_box{ height:40px; background:#f47944; padding:5px 10px; box-sizing:border-box; -webkit-box-sizing:border-box;}
        .search_text_box .search_text{ width:60px; font-size:1.2em; height:30px; line-height:30px; float:left; color:#fff;}
        .search_text_box .search_box{ margin-top:2px; background:#fff; border-radius:15px; height:26px; margin-left:60px; width:calc(100% - 60px); width:-webkit-calc(100% - 60px); }
        .search_text_box .search_box input[type=text]{float:left; font-size:0.8em; width:calc(100% - 62px); width:-webkit-calc(100% - 62px); height:24px; line-height:24px; border:none; margin-left:12px;}
        .search_text_box .search_box .search_button{ float:right; width:50px; height:26px; line-height:26px; font-size:1em; text-align:center; color:#f47944;}
    </style>
</head>
<body>
<div class="fakeloader"></div>
{php $url_search = $this->createMobileUrl('search', array(), true);}
{php $url_user = $this->createMobileUrl('usercenter', array(), true);}
<div id="wrap" style="height:100%;overflow: scroll;overflow-y:scroll;-webkit-overflow-scrolling:touch;">
    <div id="header" style="background-color: {$setting['style_base']};border-bottom: 1px solid {$setting['style_base']};">
        <section class="search_pic_box search_pic_box_fiexd clearfix">
            <!--<div class="search_pic"><img src="source/plugin/images/logo.png"></div>-->
            <div class="search_box">
                <form id="search_form" onsubmit="return false;">
                    <input type="text" name="word" placeholder="搜索商家或商品名称" id="word" style="color: #000;">
                    <div class="search_button id_search_btn" >搜索</div>
                </form>
            </div>
        </section>
    </div>
    <div id="main" style="margin-top:47px;padding-bottom: 70px;">
        <div class="box item-list" id="index-data">
            {loop $list $item}
            {if $item['default_jump']==1}
            {php $url = $this->createMobileUrl('detail', array('id' => $item['id']), true);}
            {elseif $item['default_jump']==2}
            {php $url = $this->createMobileUrl('waplist', array('storeid' => $item['id'], 'mode' => 2), true);}
            {elseif $item['default_jump']==3}
            {php $url = $this->createMobileUrl('waplist', array('storeid' => $item['id'], 'mode' => 4), true);}
            {elseif $item['default_jump']==4}
            {php $url = $this->createMobileUrl('queue', array('storeid' => $item['id']), true);}
            {elseif $item['default_jump']==5}
            {php $url = $this->createMobileUrl('reservationIndex', array('storeid' => $item['id'], 'mode' => 3), true);}
            {elseif $item['default_jump']==6}
            {php $url = $item['default_jump_url'];}
            {/if}
            <section class="item" onclick="location.href='{$url}'">
                <div class="left-wrap">
                    <img class="logo lazy" data-original="{php echo tomedia($item['logo']);}" src="{php echo tomedia($item['logo']);}" onerror="this.src='{php echo tomedia('./addons/weisrc_dish/icon.jpg');}'">
                    {if $this->getstoretimestatus($item) == 0}
                    <span class="status-tip" style="background-color: rgb(192, 192, 192);"> 商家休息 </span>
                    {/if}
                </div>
                <div class="right-wrap">
                    <section class="line">
                        <h3 class="shopname{if $item['is_brand']==1} premium{/if}">{$item['title']}</h3>
                        <div class="support-wrap">
                            {if $item['is_meal']==1}
                            <div class="activity-wrap nowrap">
                                <i class="activity-icon icononly"
                                   style="color: rgb(153, 153, 153); border-color: rgb(221, 221, 221);"> 店 </i>
                            </div>
                            <div class="tag label-red ng-scope"></div>
                            {/if}
                            {if $item['is_delivery']==1}
                            <div class="activity-wrap nowrap">
                                <i class="activity-icon icononly"
                                   style="color: rgb(153, 153, 153); border-color: rgb(221, 221, 221);"> 外 </i>
                            </div>
                            {/if}
                        </div>
                    </section>
                    <section class="line">
                        <div class="rate-wrap">
                       	<span>
                            <?php for($i=0;$i < $item['level']; $i++){ ?>
                            <i class="i-star i-star-gold"></i>
                            <?php }?>
                        </span>
                            <!--<span class="rate">4.6</span>-->
                            {if $item['sales']>0}
                            <span>已售{$item['sales']}份</span>
                            {/if}
                        </div>
                        <div class="delivery-wrap">
                            <span class="icon-delivery">
                                {if $item['is_delivery']==1}
                                准时达
                                {else}
                                商家联盟
                                {/if}
                            </span>
                        </div>
                    </section>
                    <section class="line">
                        <div class="moneylimit">
                            {if $item['is_delivery']==1}
                            {if !empty($item['sendingprice'])}
                            <span>{$setting['currency']}{$item['sendingprice']}起送</span>
                            {/if}
                            {if $item['dispatchprice']>0}
                            <span>配送费约{$setting['currency']}{$item['dispatchprice']}</span>
                            {else}
                            <span>免配送费</span>
                            {/if}
                            {if $item['freeprice']!=0.00}
                            <span>满{php echo intval($item['freeprice'])}免配送费</span>
                            {/if}
                            {else}
                            <span>{$item['address']}</span>
                            {/if}
                        </div>
                        <div class="timedistance-wrap">
                            <span class="distance-wrap">{php echo $this->getDistance($item['lat'], $item['lng'], $lat, $lng).'km';}</span>
                        </div>
                    </section>
                    {if !empty($item['newlimitprice'])}
                    <section class="line">
                        <div>
                            <i class="icon-bg1">新</i><span class="info">{$item['newlimitprice']}</span>
                        </div>
                    </section>
                    {/if}
                    {if !empty($item['oldlimitprice'])}
                    <section class="line">
                        <div>
                            <i class="icon-bg2">减</i><span class="info">{$item['oldlimitprice']}</span>
                        </div>
                    </section>
                    {/if}
                </div>
            </section>
            {php $goodslist = $item['goods']}
            {loop $goodslist $goodsitem}
            {php $goodsurl = $this->createMobileUrl('goodsdetail', array('mode' => 2, 'storeid' =>$goodsitem['storeid'], 'id' => $goodsitem['id']),true);}
            <section class="item" onclick="location.href='{$goodsurl}'">
                <div class="left-wrap" style="width: 80px;height: 80px;">
                    <img class="logo lazy" data-original="{php echo tomedia($goodsitem['thumb']);}" src="{php echo tomedia($goodsitem['thumb']);}" onerror="this.src='{php echo tomedia('./addons/weisrc_dish/icon.jpg');}'" style="width: 200px;border-radius:0px;">
                </div>
                <div class="right-wrap">
                    <section class="line">
                        <h3 class="shopname{if $goodsitem['is_brand']==1} premium{/if}">{$goodsitem['title']}</h3>
                        <div class="support-wrap">
                        </div>
                    </section>
                    <section class="line">
                        <div class="rate-wrap">

                            {if $goodsitem['sales']>0}
                            <span>已售{$goodsitem['sales']}份</span>
                            <br/>
                            {/if}

                            <span class="rate" style="font-size: 16px;margin-top: 5px;">
                                {$setting['currency']}<em>{$goodsitem['marketprice']}</em>
                            </span>
                        </div>
                        <div class="delivery-wrap">
                            <span class="icon-delivery">

                            </span>
                        </div>
                    </section>
                    <section class="line">
                        <div class="moneylimit">
                            {if $goodsitem['is_delivery']==1}
                            {if !empty($goodsitem['sendingprice'])}
                            <span>{$setting['currency']}{$goodsitem['sendingprice']}起送</span>
                            {/if}
                            {if $goodsitem['dispatchprice']>0}
                            <span>配送费约{$setting['currency']}{$goodsitem['dispatchprice']}</span>
                            {else}
                            <span>免配送费</span>
                            {/if}
                            {if $goodsitem['freeprice']!=0.00}
                            <span>满{php echo intval($goodsitem['freeprice'])}免配送费</span>
                            {/if}
                            {else}
                            <span>{$goodsitem['address']}</span>
                            {/if}
                        </div>
                        <div class="timedistance-wrap">
                            <span class="distance-wrap"></span>
                        </div>
                    </section>
                </div>
            </section>
            {/loop}
            {/loop}
        </div>
        <div class="popup-overlay"></div>
        <div class="top-btn" style="display: block;">
            <a class="react">
                <i class="text-icon">⇧</i>
            </a>
        </div>
        <script>
            //top行为
            $('.top-btn').on('click',function(){
                $("html, body").animate({ scrollTop: 0 }, "slow");
            });
            if ($(document).scrollTop() == 0) {
                $('.top-btn').css('display','none');
            }
            $(document).bind('scroll',function() {
                if ($(document).scrollTop() == 0) {
                    $('.top-btn').css('display','none');
                }else{
                    $('.top-btn').css('display','block');
                }
            })
        </script>
    </div>
    <script>
        $(document).ready(function(e) {
            $('.filter-header .filter-nav').click(function(e) {
                var index=$(this).index()
                var datavalue=$(this).attr('data-value')//判断是否显示
                if(datavalue==1){
                    $('.filter-header .filter-nav').attr('data-value',0)
                    $(this).find('.i-up').css({"transform":"rotate(0deg)"})
                    $(this).find('span').removeClass('curt')
                    $('.filter-extend').eq(index).removeClass('open');
                    $('.popup-overlay').removeClass('modal-overlay-visible')
                }else{
                    $('.filter-header .filter-nav').attr('data-value',0)
                    $(this).attr('data-value',1)//判断是否显示
                    $('.filter-header .filter-nav span').removeClass('curt')
                    $(this).find('span').addClass('curt')
                    $('.filter-header .filter-nav').find('.i-up').css({"transform":"rotate(0deg)"})
                    $(this).find('.i-up').css({"transform":"rotate(180deg)"})
                    $('.filter-extend').removeClass('open')
                    $('.filter-extend').eq(index).addClass('open');
                    $('.popup-overlay').addClass('modal-overlay-visible')
                }
            });
        });
    </script>
</div>
{php echo register_jssdk(false);}
<script>
    wx.ready(function () {
        sharedata = {
            title: '{$share_title}',
            desc: '{$share_desc}',
            link: '{$share_url}',
            imgUrl: '{$share_image}',
            success: function(){
                //alert('感谢分享');
            },
            cancel: function(){
                //alert('cancel');
            }
        };
        wx.onMenuShareAppMessage(sharedata);
        wx.onMenuShareTimeline(sharedata);
    });
</script>
{php include $this->template($this->cur_tpl.'/_nave');}
<script type="text/javascript" src="{RES}/js/jquery.lazyload.min.js"></script>
<script>
    $(function () {
        $("img.lazy").lazyload({effect: "fadeIn"});
    });
    $(".id_search_btn").click( function (){
        var word = $('#word').val();
        if (word == '') {
            alert('请输入搜索关键字！');
            return false;
        }
        window.location.href = "{php echo $this->createMobileUrl('search', array(), true)}" + "&searchword=" + word;
    });
</script>
</body>
</html>
